package com.shrct.businessprocess.product;

import com.shrct.businessprocess.organization.RCEnterprise;
import com.shrct.businessprocess.product.RCIdentifiablePhysicalProductEntry;
import com.shrct.businessprocess.product.RCProductSpecification;
import com.shrct.businessprocess.project.RCProject;
import com.shrct.businessprocess.purchase.RCBudgetContractProductItem;
import com.shrct.businessprocess.purchase.RCPurchaseOrderItem;
import edu.fudan.mylang.pf.IDAOService;
import java.util.Date;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;

public interface RCIdentifiablePhysicalProductEntryDAO extends IDAOService<RCIdentifiablePhysicalProductEntry> {
  public abstract RCIdentifiablePhysicalProductEntry create(final String _sid, final Procedure1<? super RCIdentifiablePhysicalProductEntry> postInit);
  
  public abstract Boolean isSidUnique(final String sid);
  
  /**
   * 产品登记。主要用于初始化数据的导入
   */
  public abstract RCIdentifiablePhysicalProductEntry _registerPhysicalProduct(final String projectid, final RCEnterprise enterprise, final String _sid, final Integer count);
  
  public abstract void transferPhysicalPruduct(final RCProject project, final RCIdentifiablePhysicalProductEntry product, final RCEnterprise enterprise, final Date serviceStartDate);
  
  public abstract void cancelTransferPhysicalPruduct(final RCIdentifiablePhysicalProductEntry product);
  
  public abstract RCIdentifiablePhysicalProductEntry registPartPhysicalProduct(final String sid, final String parentSid);
  
  public abstract RCIdentifiablePhysicalProductEntry importPhysicalProduct(final String projectid, final RCEnterprise enterprise, final String sid);
  
  /**
   * 产品入库，登记产品并将其入库至云多的库存
   * purchaseItem 为对应的合同清单的内容，需要追踪承诺服务信息
   */
  public abstract RCIdentifiablePhysicalProductEntry inStockPhysicalProduct(final String sid, final RCPurchaseOrderItem orderItem, final RCBudgetContractProductItem contractItem, final Integer count);
  
  public abstract void cancelInStockPhysicalProduct(final RCIdentifiablePhysicalProductEntry product);
  
  public abstract RCIdentifiablePhysicalProductEntry findProductBySid(final String sid);
  
  public abstract RCIdentifiablePhysicalProductEntry registerExternalProduct4Service(final String projectid, final RCEnterprise customer, final String sid, final RCProductSpecification productSpec);
}
